import {
	createStore
} from 'vuex'
import createPersistedState from 'vuex-persistedstate' // 引入持久化插件

export default createStore({
	state: {
		user: null,
		token: null,
		mobile: null,
		password: null,
		typeNum: null,
		videoUrl: null,
		deviceService: null,
		repair: null,
		styleId: null,
		deviceId: null,
		noseCode: null,
		device: null,
		capitalDevice: null,
		arrangeOrder: null,
		deviceKind: null,
		kind: null,
		craft: null,
		craftId: null,
		accessoryOrder: null,
		proOrder: null,
		style: null,
		proOrderId: null,
		language: 'zh',
		stdSewInfo: null,
		workshop: null,
		proLine: null,



	},
	mutations: {
		setUser(state, user) {
			state.user = user;
		},
		setToken(state, token) {
			state.token = token;
		},
		setMobile(state, mobile) {
			state.mobile = mobile;
		},
		setPassword(state, password) {
			state.password = password;
		},
		setTypeNum(state, typeNum) {
			state.typeNum = typeNum;
		},
		setVideoUrl(state, videoUrl) {
			state.videoUrl = videoUrl;
		},
		setDeviceService(state, deviceService) {
			state.deviceService = deviceService;
		},
		setRepair(state, repair) {
			state.repair = repair;
		},
		setStyleId(state, styleId) {
			state.styleId = styleId;
		},
		setDeviceId(state, deviceId) {
			state.deviceId = deviceId;
		},

		setNoseCode(state, noseCode) {
			state.noseCode = noseCode;
		},

		setDevice(state, device) {
			state.device = device;
		},
		setCapitalDevice(state, capitalDevice) {
			state.capitalDevice = capitalDevice;
		},
		setArrangeOrder(state, arrangeOrder) {
			state.arrangeOrder = arrangeOrder;
		},

		setDeviceKind(state, deviceKind) {
			state.deviceKind = deviceKind;
		},

		setKind(state, kind) {
			state.kind = kind;
		},
		setCraft(state, craft) {
			state.craft = craft;
		},
		setAccessoryOrder(state, accessoryOrder) {
			state.accessoryOrder = accessoryOrder;
		},

		setProOrder(state, proOrder) {
			state.proOrder = proOrder;
		},
		setStyle(state, style) {
			state.style = style;
		},
		setProOrderId(state, proOrderId) {
			state.proOrderId = proOrderId;
		},
		setCraftId(state, craftId) {
			state.craftId = craftId;
		},
		setLanguage(state, language) {
			state.language = language;
		},
		setStdSewInfo(state, stdSewInfo) {
			state.stdSewInfo = stdSewInfo;
		},
		setWorkshop(state, workshop) {
			state.workshop = workshop;
		},
		setProLine(state, proLine) {
			state.proLine = proLine;
		},


	},
	actions: {

	},
	modules: {

	},
	plugins: [
		// createPersistedState({
		// 	storage: window.localStorage
		// })
		createPersistedState()
	]

})
